<?php
$menuinfo = $this->tables['menuinfo'];
$menuclassinfo = $this->tables['menuclassinfo'];
$appmodulename = $menuclassdir = '';
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
$actionname = 'add';
if ($id == 0) {
    $menuinfo['menuclassid'] = 0;
    $menuinfo['name'] = '';
    $menuinfo['title'] = '';
    $menuinfo['visible'] = 0;
    $menuinfo['enable'] = 1;
} else {
    $actionname = 'edit';
    $appmodulename = $menuclassinfo['companyname'] . '-' . $menuclassinfo['projectname'] . '_' . $menuclassinfo['modulename'];
    $menuclassdir = $menuclassinfo['parentdir'] . '_' . $menuclassinfo['name'];
}
?>
<div class="pageContent">
    <form method="post" action="?c=<?= app::$CONTROLLER_NAME ?>&a=<?= $actionname ?>&id=<?= $id ?>" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);">
        <div class="pageFormContent" layoutH="56">
            <dl>
                <dt>所属项目模块：</dt>
                <dd>
                    <input type="text" name="appmodulename" readonly="readonly" class="required" value="<?= $appmodulename ?>"/>
                    <input type="hidden" target="projmoduleid" id="projmoduleid" name="projmoduleid" readonly="readonly" value="<?= $menuclassinfo['projmoduleid'] ?>"/>
                    <a class="btnLook" href="?c=sys_projmodule&a=list" lookupGroup="">查找项目模块</a>

                </dd>
            </dl>
            <dl>
                <dt>所属菜单分类：</dt>
                <dd>
                    <input type="text" id="parentclassinfo_parentpath"  name="parentpath" class="required" readonly="readonly" value="<?= $menuclassdir ?>"/>
                    <input type="hidden" name="menuclassid" readonly="readonly" value="<?= $menuinfo['menuclassid'] ?>"/>
                    <a class="btnLook" href="?c=sys_menuclass&a=list&search[projmodule.id]={projmoduleid}" lookupGroup="">查找菜单分类</a>
                </dd>
            </dl>
            <dl>
                <dt>菜单项英文名称：</dt>
                <dd><input type="text" name="name" class="required" value="<?= $menuinfo['name'] ?>" alt="菜单项英文名称"/></dd>
            </dl>
            <dl>
                <dt>菜单项显示名称：</dt>
                <dd><input type="text" name="title" class="required" value="<?= $menuinfo['title'] ?>" alt="菜单项中文名称"/></dd>
            </dl>
            <dl>
                <dt>是否启用：</dt>
                <dd><span style="color:green;"><input type="radio" name="enable" value="1" <? if ($menuinfo['enable'] == 1) { ?>checked="checked"<? } ?> />启用</span>
                    <span style="color:red;"><input type="radio" name="enable" value="0" <? if ($menuinfo['enable'] == 0) { ?>checked="checked"<? } ?> />禁用</span></dd>
            </dl>
            <dl>
                <dt>是否显示：</dt>
                <dd><span style="color:green;"><input type="radio" name="visible" value="1" <? if ($menuinfo['visible'] == 1) { ?>checked="checked"<? } ?> />显示</span>
                    <span style="color:red;"><input type="radio" name="visible" value="0" <? if ($menuinfo['visible'] == 0) { ?>checked="checked"<? } ?> />隐藏</span></dd>
            </dl>
        </div>
        <div class="formBar">
            <ul>
                    <!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
                <li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
                <li>
                    <div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
                </li>
            </ul>
        </div>
    </form>
</div>
